﻿@model IEnumerable<EventPlanner.Models.UserViewModel>

@{
    ViewBag.Title = "Usuarios";            
}
   

<div class="subtitle">
<h2>Usuarios</h2>
</div>
<p></p>
@Html.Partial("_Busqueda_Usuarios")
<p></p>
<table>
    <tr>
        <th>
              @Html.ActionLink(@EventPlanner.Resources.Account.Register.lbl_NombreUsuario, "Index", new { sortOrder = ViewBag.UserNameSortParm }) @Html.Raw((string)ViewBag.UserNameAddOn)
        </th>
        <th>
             @Html.ActionLink(@EventPlanner.Resources.Account.Register.lbl_Correo, "Index", new { sortOrder = ViewBag.EmailSortParm }) @Html.Raw((string)ViewBag.EmailAddOn)
        </th>
        <th>
             @Html.ActionLink(@EventPlanner.Resources.Account.Details.lbl_TipoCuenta, "Index", new { sortOrder = ViewBag.RoleSortParm }) @Html.Raw((string)ViewBag.RoleAddOn)
        </th>
        <th>
            Activa
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Email)
        </td>
         <td>
            @Html.DisplayFor(modelItem => item.Role)
        </td>
          <td>
        @if (Membership.GetUser(item.UserName).IsApproved) { 
            @Html.Raw(@EventPlanner.Resources.Global.Global.lbl_Si);

          }
          else
          {
              @Html.Raw(@EventPlanner.Resources.Global.Global.lbl_No);
          }
            </td>
        <td>
           
            @Html.ActionLink(@EventPlanner.Resources.Global.Global.lbl_Detalles, "DetailsAdmin", new { Name = item.UserName }) |
            @Html.ActionLink(@EventPlanner.Resources.Global.Global.lbl_Borrar, "Delete", new { Name = item.UserName })             
        </td>
    </tr>
}

</table>
<p></p>
@Html.Partial("_Navegacion_Usuarios",Model)